import { createRouter, createWebHistory } from "vue-router";
const routes = [
  {
    path: "/",
    name: "home",
    meta: {
      title: "AI审方",
      keepAlive: false,
    },
    component: () => import("@/views/Home.vue"),
  },
  {
    path: "/detail",
    name: "detail",
    meta: {
      title: "审单详情",
      keepAlive: false,
    },
    component: () => import("@/views/Detail.vue"),
  },
  // {
  //   //实现路由重定向，当进入网页时，路由自动跳转到路由
  //   redirect: "/viewPage",
  //   path: "/",
  // },
];

const router = createRouter({
  history: createWebHistory("/"),
  routes,
  scrollBehavior: () => ({ left: 0, top: 0 }),
});
router.beforeEach((to, from, next) => {
  console.log(to, from)
  // global.routerName = from.name
  next();
});
export default router;
